package com.ruoyi.wzgl.bfckcx.controller;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.wzgl.bfckcx.domain.Bfckcx;
import com.ruoyi.wzgl.bfckcx.service.IBfckcxService;
import com.ruoyi.wzgl.grlyckcx.domain.Grlyckcx;
import com.ruoyi.wzgl.grlyckcx.service.IGrlyckcxService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 报废出库查询Controller
 *
 * @author huacai
 * @date 2024-12-10
 */
@RestController
@RequestMapping("/wzgl/bfckcx")
public class BfckcxController extends BaseController {
    @Resource
    private IBfckcxService bfckcxService;

    /**
     * 查询报废出库列表
     */
    @GetMapping("/selectBfCkList")
    public TableDataInfo selectBfCkList(Bfckcx bfckcx) {
        startPage();
        List<Bfckcx> list = bfckcxService.selectBfCkList(bfckcx);
        return getDataTable(list);
    }

    /**
     * 导出报废出库列表
     */
    @Log(title = "报废出库列表", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, Bfckcx bfckcx) {
        List<Bfckcx> list = bfckcxService.selectBfCkList(bfckcx);
        ExcelUtil<Bfckcx> util = new ExcelUtil<Bfckcx>(Bfckcx.class);
        util.exportExcel(response, list, "报废出库列表", "报废出库查询列表");
    }

}
